package day18;
//测试 反射
public class Test1 {
    public static void main(String[] args) throws ClassNotFoundException {
        method();//获取Class对象
    }
    //获取Class对象--用来解析.class文件里的所有数据
    public static void method() throws ClassNotFoundException {
        //参数是类的全路径 -- 包名.类名
        Class c = Class.forName("java.lang.String");
        Class c2 = String.class;
        Class c3 = new String().getClass();
        System.out.println(c);
        System.out.println(c2);
        System.out.println(c3);
    }

}
